#! /usr/bin/python

import os.path

def walkcallback(arg, dirname, names):
    """ walkcallback:
          This callback function is used to process any found Java files
          during a file tree walk (preferable done with os.path.walk).

          It checks a 'package foo.bar' against the directory that the 
          found Java file is located in, and issues a warning if there
          seems to be a problem (i.e. the package statement differs in
          where the file should be located -> problems later on).

        Parameters:
          arg = Argument propagted from orignating call to os.path.walk
          dirname = The name of the directory that is currentl under consideration
                    (it is given relative to the starting directory)
          names = The files present in the directory 'dirname'
    """

    if names:
        print names


def help():
    """ help:
          Print usage information.
    """


def main():
    """ main:
          Parses imput options and starts up the calling sequence of functions 
          that will:

            1) Walk the directory tree
            2) Check for problems
            3) Warn about any Java files that have erroneus package statements
    """

    # Parse paramters.
    try:
        opts, args = getopt.getopt(sys.argv[1:], 'cfhp:rv')
    except getopt.GetoptError:
        help()
        sys.exit(2)

    for o, a in opts:
        if o == '-h':
            help()
            sys.exit(0)
        else:
            message('ERROR', 'Bad parameter: ' + o)
            help()
            sys.exit(1)



    top = 'top'

    os.path(top)
